Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Async Disposable Action #315

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Added Async Disposable Action #315

merged 1 commit into from
Oct 2, 2024

Conversation

niemyjski
Copy link
Member

The only usage across our libs is in test base which kinda made me want to remove DisposibleAction.

The other usages are for repositories and hence this add. I don't love the name.

image

@niemyjski niemyjski self-assigned this Oct 2, 2024
@niemyjski niemyjski requested a review from ejsmith October 2, 2024 16:27

_exitAction();
_disposed = true;
var exitAction = Interlocked.Exchange(ref _exitAction, null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add the locking here? I've never seen any dispose methods have locking in them. I'm pretty sure the .NET runtime isn't going to call dispose a bunch of times. I suppose you could call it manually a bunch of times in a row, but it still seems like overhead to add locking here.

@niemyjski niemyjski merged commit b851839 into main Oct 2, 2024
3 checks passed
@niemyjski niemyjski deleted the feature/disposable-action branch October 2, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants